<template slot-scope="scope">
    <div id="idtable1" class="app-container" style="width: 99%; overflow: hidden; background: #ffffff; display: block; margin-left: 20px">

                <div style="height: 8px"></div>
                <!-- <el-input v-model="searchlx" placeholder="请输入项目名称" class="input_search"></el-input>&nbsp;&nbsp;
                <el-button type="primary" @click="topage()" class="bthSearch">搜索</el-button> -->
                <el-button type="primary" @click="topage()" class="bthSearch">新增坐标</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">导入坐标</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">保存坐标</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">导出坐标</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">删除所有</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">检查结果</el-button>
                <el-button type="primary" @click="topage()" class="bthSearch">下载模板</el-button>

<!-- <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="80%"
      height="100%"
      :before-close="handleClose"
    >
      <iframe src="/tabs" frameborder="0" width="100%" height="600px"></iframe>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog> -->
                <div style="height: 8px"></div>
                <div class="app-container">
                    <el-table
                        :data="zbinfo"
                        border
                        :row-style="{ height: '30px' }"
                        :header-cell-style="{ background: '#005ab5', color: 'black' }"
                        :row-class-name="rowClassName"
                        @selection-change="handleSectionChange"
                        style="font-size: 15px; font-family: microsoft yahei; color: black"
                    >
                        <el-table-column type="selection" width="50px" align="center" header-align="center"></el-table-column>
                        <el-table-column label="序号" prop="xh" width="70px" align="center" header-align="center"></el-table-column>
                        <el-table-column label="地块号" prop="address" align="left" header-align="left"></el-table-column>
                        <el-table-column label="圈号" prop="ring" align="left" header-align="left"></el-table-column>
                        <el-table-column label="点号" prop="point" align="left" header-align="left"></el-table-column>
                        <el-table-column label="X坐标" prop="longitude" align="left" header-align="left"></el-table-column>
                        <el-table-column label="Y坐标" prop="dimension" align="left" header-align="left"></el-table-column>
                    </el-table>
                </div>
                <el-pagination
                    :current-page="page"
                    :page-size="limit"
                    :total="total"
                    style="padding: 30px 0; text-align: center"
                    background
                    layout="total, prev, pager, next, jumper"
                    @current-change="getList"
                />
    </div>
</template>

<script>
import $ from 'jquery';
import information from '../../../../api/lx_infor/lx_xx';
export default {

    data() {
        return {
            dialogVisible: false, //弹出框
            zbinfo:{},
            page: 1,
            limit: 10,
            total: 0,
            courseQuery: {},
            tableChecked: [],
            tabledatas: [],
            searchlx: ''
        };
    },
    created() {
        
        setTimeout(function () {
            setPaginationFontSize();
        }, 100);
        this.getList();
    },

    methods: {
        newdaka(){
            this.dialogVisible = true;
        },
        rowClassName({ row, rowIndex }) {
            //row.xh = rowIndex + 1;
            row.xh = (this.page - 1) * 10 + 1 + rowIndex;
        },
        newdod() {
            window.open("/#/lx_area_xm_input?typeid="+$('#idframe', window.parent.document).attr('data-id'))
            // this.dialogVisible = true;
            // if ($('#idframe').attr('src') == undefined) {
            //     setTimeout(function () {
            //         dialogFrameSrc(stype);
            //     }, 500);
            // } else {
            //     dialogFrameSrc(stype);
            // }
            // this.eldiaglog_title = stitle;
        },
        //跳转页面
        topage() {
            const { href } = this.$router.resolve({ path: '/lx_area_xm_input' ,query:{typeid:$('#idframe', window.parent.document).attr('data-id')}});
            window.open(href, '_blank');
        },
        //获取信息
        getList(page = 1) {
            this.page = page;
            information.page(this.page, this.limit,$('#idframe', window.parent.document).attr('data-id'),1).then((response) => {
                this.zbinfo = response.data.rows;
                this.total = response.data.total;
            });
        },
        //批量删除
        dels() {
            if (this.tableChecked.length == 0) {
                alert('请选择删除的项目');
            } else {
                var _this = this;
                _this
                    .$confirm('此操作将删除记录, 是否继续?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    })
                    .then(() => {
                        //点击确定，执行then方法
                        //调用删除的方法
                        for (let i = 0; i < this.tableChecked.length; i++) {
                            information.deleteInformation(this.tableChecked[i].id);
                            this.getList();
                        }
                        this.badCodeSelection = [];
                    }); //点击取消，执行catch方法
            }
        },
        handleSectionChange(val) {
            this.tableChecked = val;
        }
    }
};
function setPaginationFontSize() {
    if ($('.el-pagination__total').css('font-size') == '13px'){
        $('.el-pagination__total').css('font-size', '15px');
        $('.el-pagination__jump').css('font-size', '15px');
    }else{
        setTimeout(function () {
            setPaginationFontSize();
        }, 100);
    }    
}
function dialogFrameSrc(stype) {
    switch (stype){
        case 'xminfo':
            window.open("view?path=/#/lx_area_xm_input")
            //$('#iddivframe').html('<iframe id="idframe" src="view?path=/#/projectdetial" frameborder="0" width="100%" height="600px"></iframe>');
            break;
        case 'sxt':
            //$('#iddivframe').html('<iframe id="idframe" src="view?path=/#/table_sxt" frameborder="0" width="100%" height="600px"></iframe>');
            break;
    }
    // if (stype == 'sxt') {
    //     //$('#iddivframe').html('<iframe id="idframe" src="/#/table_sxt" frameborder="0" width="100%" height="600px"></iframe>');
    //     $('#iddivframe').html('<iframe id="idframe" src="view?path=/#/table_sxt" frameborder="0" width="100%" height="600px"></iframe>');
    // } else {
    //     $('#iddivframe').html('<iframe id="idframe" src="http://www.baidu.com" frameborder="0" width="100%" height="600px"></iframe>');
    // }
}
</script>

<style>
.el-table th {
    background-color: #e2e2e2 !important;
}
.el-table .cell {
    text-overflow: clip;
}
.input_search {
    width: 150px;
}
.divtitle {
    font-family: 微软雅黑;
    font-size: 25px;
    color: #356cb3;
}
.btnSearchAdv {
    border-color: #356cb3;
    color: #356cb3;
    font-size: 15px;
    font-family: 微软雅黑;
}
.bthSearch {
    background-color: #356cb3;
    font-size: 15px;
    font-family: 微软雅黑;
}
.bthNormal {
    border-color: #848484;
    font-size: 15px;
    font-family: 微软雅黑;
}
.el-tabs--border-card {
    border: 1px solid #ffffff;
}
.lableFont {
    font-size: 15px;
    font-family: 微软雅黑;
    color: black;
}

.tabPaneLs .el-icon-lx-home {
    background-image: url('../../../../assets/img/el-tab-pane-dkjl.png') !important;
    background-size: 100% 99%;
}
.tabPaneLs .el-icon-lx-home::before {
    visibility: hidden;
}

.tabPaneTj .el-icon-lx-home {
    background-image: url('../../../../assets/img/el-tab-pane-dktj.png') !important;
    background-size: 100% 99%;
}
.tabPaneTj .el-icon-lx-home::before {
    visibility: hidden;
}
.fontNormal {
    color: #356cb3;
    font-size: 15px;
    font-family: 微软雅黑;
}
.pageNormal {
    padding: 30px 0;
    text-align: center;
    font-size: 15px;
    font-family: 微软雅黑;
    color: black;
}

.el-pagination__total {
    color: #000000;
    font-family: 微软雅黑;
}
.el-pagination__jump {
    color: #000000;
    font-family: 微软雅黑;
}
</style>